// 导入axios 
import axios from "axios";
// 定义常量 记录服务器地址
const HOST_URL = 'https://apic.netstart.cn/yunyuedu';
// 对象对象 记录接口地址
const list = '/store/navi.json';
const phlist = '/store/merged/rankNavi.json';
const fllist = '/store/node.json';
const bookxq = '/book/info.json';
const booktext = '/book/getsub.json';
const booklist = '/reader/book/info.json';
const bookcont = '/reader/book/content.json';
const newbook = '/book/simpleInfo.json';
const hotserch = '/search/getHotWords';
const serch = '/search/book.json';
const serchlist = '/search/searchHint';
const pllist = '/comment/getComments.json'
const fldatalist = '/source/v2/searchBook.json'
export const recommendFunc = (data) => {
    return axios.get(`${HOST_URL}${list}`, { params: data })
        .then(reslist => reslist.data)
}
export const phFunc = (data) => {
    return axios.get(`${HOST_URL}${phlist}`, { params: data })
        .then(reslist => reslist.data)
}
export const flFunc = (data) => {
    return axios.get(`${HOST_URL}${fllist}`, { params: data })
        .then(reslist => reslist.data)
}
export const bkFunc = (data) => {
    return axios.get(`${HOST_URL}${bookxq}`, { params: { sourceUuid: data } })
        .then(reslist => reslist.data)
}
export const bkxqFunc = (data1, data2) => {
    return axios.get(`${HOST_URL}${booktext}`, { params: { id: data1, title: data2 } })
        .then(reslist => reslist.data)
}
export const newbFunc = (data) => {
    return axios.get(`${HOST_URL}${newbook}`, { params: { id: data } })
        .then(reslist => reslist.data)
}
export const bklistFunc = (data) => {
    return axios.get(`${HOST_URL}${booklist}`, { params: { source_uuid: data } })
        .then(reslist => reslist.data)
}
export const bcFunc = (data1, data2) => {
    return axios.get(`${HOST_URL}${bookcont}`, { params: { source_uuid: data1, content_uuid: data2 } })
        .then(reslist => reslist.data)
}
export const hotFunc = () => {
    return axios.get(`${HOST_URL}${hotserch}`, {})
        .then(reslist => reslist.data)
}
export const serchFunc = (data) => {
    return axios.get(`${HOST_URL}${serch}`, { params: { keyword: data } })
        .then(reslist => reslist.data)
}
export const plFunc = (data) => {
    return axios.get(`${HOST_URL}${pllist}`, { params: { bookId: data } })
        .then(reslist => reslist.data)
}
export const serchlistFunc = (data) => {
    return axios.get(`${HOST_URL}${serchlist}`, { params: { search: data } })
        .then(reslist => reslist.data)
}
export const fllistFunc = (data1, data2, data3, data4, data5) => {
    return axios.get(`${HOST_URL}${fldatalist}`, {
        params: {
            catId: data1, pay: data2,
            bookStatus: data3,
            wordCount: data4,
            sort: data5
        }
    })
        .then(reslist => reslist.data)
}
export const reFunc = (url) => {
    return axios.get(`${HOST_URL}${url}`, {})
        .then(reslist => reslist.data)
}


